﻿<div class="k-block divToolbar" style="margin:5px">
    <div style="display:inline-block;">
        <b>年级：</b><select id="selGrade"></select>
    </div>
</div>
<div id="tbs_evaluation"></div>

<script class="init">
    LocatedMenu("国家标准", "评分标准");

    $("#selGrade").kendoDropDownList({
        dataTextField: "GradeName",
        dataValueField: "Code",
        dataSource: Whale.dataSource({
            url: "/School/Config/GetAllGrades"
        }),
        change: function (e) {
            Filter();
        }
    })
</script>

<script>
    function Filter()
    {
        $("#tbs_evaluation").empty();
        var gradeCode = $("#selGrade").data("kendoDropDownList").value();
        var subjects = Whale.Remote.GetCollection({
            url: "/Standard/Subject/GetSubjects",
            parameters: {
                gradeCode: gradeCode,
                category: "1,2,3"
            }
        });
        if (subjects != null && subjects.Total > 0) {
            var urls = [];
            $.each(subjects.Data, function (i, o) {
                var url = ["/Standard/Evaluation/Primary/" + o.ID + "/" + gradeCode + "/false"];
                if (o.Category == 1)
                    url = ["/Standard/Evaluation/EBMI/" + gradeCode];
                $.merge(urls, url);
            });
            $("#tbs_evaluation").kendoTabStrip({
                dataSource: subjects.Data,
                dataTextField: "SubjectName",
                contentUrls: urls
            }).data("kendoTabStrip").select(0);
        }
    }
    Filter();
</script>